/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.almori.hr.timetracker;

//import java.beans.*;
import java.io.Serializable;
//import java.sql.*; 
import java.util.List;

/**
 * @author gcastillo, nbenavidez
 */
public class MgrDashBean implements Serializable {
     public int companyId = 0;
     public String getPartialSearchHTML()
     {
                    return    "<form action='#' method='GET'>"
                                     +    "<div class='inputs'>"
                                     +     "<input type='login' id='login' name='login' placeholder='Search by Employee' autofocus='true' style='border: 1px solid #737b8d;text-align:center;' />"
                                     +      "<br />"
                                     +      "<input id ='submit' type='submit' value='LOOK UP' />"
                                     +    "</div>"
                                     + "</form>"
                                     +      "<br />";
                              
     }
     public String getPartialAddEmployeeHTML()
     {
                    return    "<form action='#' method='GET'>"
                                     +    "<div class='inputs'>"
                                     +     "<input type='login' id='login' name='login' placeholder='Firstname' autofocus='true' style='border: 1px solid #737b8d;text-align:center;' />"
                                     +      "<br />"
                                     +     "<input type='login' id='login' name='login' placeholder='Lastname' autofocus='true' style='border: 1px solid #737b8d;text-align:center;' />"
                                     +      "<br />"
                                     +     "<input type='login' id='login' name='login' placeholder='CED' autofocus='true' style='border: 1px solid #737b8d;text-align:center;' />"
                                     +      "<br />"
                                     +     "<input type='password' id='password' name='password' placeholder='Password' autofocus='true' style='border: 1px solid #737b8d;text-align:center;' />"
                                     +      "<br />"
                                     +     "<input type='login' id='login' name='login' placeholder='Department' autofocus='true' style='border: 1px solid #737b8d;text-align:center;' />"
                                     +      "<br />"
                                    
                                     +      "<input id ='submit' type='submit' value='CREATE' />"
                                     +    "</div>"
                                     + "</form>"
                                     +      "<br />";
                               //      + "<hr style='border-color:lightgray;width: 70%;' />";
                    
     }
     public String getPartialImportCSVHTML()
     {
                    return     "<form action='#' enctype='multipart/form-data' action='#' method='POST'>"
                                     +    "<div class='inputs'>"
                                     +    "<input type='file' name='file' id='file' style='font-size: 14px;background-color: #1BB7DF; color: #fff;'><br>"
                                     +      "<input id ='submit' type='submit' value='UPLOAD' />"
                                     +    "</div>"
                                     + "</form>"
                                     +      "<br /><br />";
                    
     }
     public String getPartialReportHTML(String deptId)
     {
                    return   "  <br/><br/><h3 style='color:#1BB7DF;'>Reportes</h3> <br />"
                                      + " <table border='0' align='center'>"
                                      + "<tr>"
                                      + "<td><a href='/birt-viewer/frameset?__report=alm.hr.time.tracker.01.rptdesign&emp_id="+deptId+"' target='_blank'><img src='img/report-bydate.png' height='90' width='90' align='middle'></img> <p id='imgtxt'><font size='1'>POR FECHA</font></p><a>"
                                      + "</td>"
                                      + "<td><a href='/birt-viewer/frameset?__report=alm.hr.time.tracker.02.rptdesign' target='_blank'><img src='img/report.png' height='90' width='90' align='middle'></img> <p id='imgtxt'><font size='1'>POR EMPLEADO</font></p><a>"
                                      + "</td>"
                                      + "<td><a href='/birt-viewer/frameset?__report=alm.hr.time.tracker.04.rptdesign' target='_blank'><img src='img/table-colums-icon.png' height='90' width='90' align='middle'></img> <p id='imgtxt'><font size='1'>DETALLE ACTIVIDAD</font></p><a>"
                                      + "</td>"
                                      + "<td><a href='/birt-viewer/frameset?__report=alm.hr.time.tracker.05.rptdesign&emp_id="+deptId+"' target='_blank'><img src='img/report.break.png' height='90' width='90' align='middle'></img> <p id='imgtxt'><font size='1'>RESUMEN RECESOS</font></p><a>"
                                      + "</td>"
                                      + "</tr>"
                                      + "</table>"
                                      +  "<br />"
                                      +  "<br />";          
     }
     // Use to edit timecards by employee in edittimecard.jsp
     public String getEmployeeListHTML(int id_dept) throws java.sql.SQLException,java.lang.Exception{
                    String HTMLPartial = "";
                    com.almori.hr.timetracker.TimeTrackerBean b = new com.almori.hr.timetracker.TimeTrackerBean();
                    List<Employee> employees = b.getEmployeeListByDept(id_dept);
                    HTMLPartial += "<label> Departamento: </label><b>" + employees.get(0).getDepartment().getDescription() + "</b>";
                    HTMLPartial += "<label><a href='edittimecards.jsp' style='float: center; font-size:12px; text-decoration: none;' >(Cambiar departamento)</a></label>";
                    HTMLPartial += "<label>Colaborador: </label> ";
                    HTMLPartial += "<select name='employee' id='combo'><br/> ";
                    
                                       try{
                                           for(int i=0; i< employees.size();i++)
                                           {
                                                HTMLPartial += "<option value='" + employees.get(i).getId() + "'>" + employees.get(i).getfName() + " " + employees.get(i).getlName() + "</option>";
                                           }
                                       }
                                       catch(Exception e)
                                       {
                                           HTMLPartial += "<option value='0'>Error: cannot access DataBase!</option>";
                                       }
                    
                    HTMLPartial +=    "  </select> "
                                    +    "  <br />"
                                    +    "   <input id ='submit' type='submit' value='BUSCAR' />"
                                    +    " <br />"
                                    +    " <div  class='clean-lightblue'> "
                                    +    " <input type='hidden' name='dept' value='" + id_dept + "' />"
                                    +    " <input type='radio' name='15days' value='1'> Quincena previa </input>"
                                    +    " <input type='radio' name='15days' value='2' checked='true'> Quincena en curso </input>"
                                    +    " </div>"
                                    +    " <br /><br />" ;
                    return HTMLPartial;
     }
     
      public String getEmployeeListHTML(int id_dept, String departmentName, int empl_id, int q) throws java.sql.SQLException,java.lang.Exception{
                    String HTMLPartial = "";
                    com.almori.hr.timetracker.TimeTrackerBean b = new com.almori.hr.timetracker.TimeTrackerBean();
                    List<Employee> employees = b.getEmployeeListByDept(id_dept);
                    HTMLPartial += "<label> Departamento: </label><b>" + employees.get(0).getDepartment().getDescription() + "</b>";
                    HTMLPartial += "<label><a href='edittimecards.jsp' style='float: center; font-size:12px; text-decoration: none9' >(Cambiar departamento)</a></label>";
                    HTMLPartial += "<label>Colaborador: </label> ";
                    HTMLPartial += "<select name='employee' id='combo'><br /> ";
                    
                                       try{
                                           for(int i=0;i<employees.size();i++)
                                           {
                                               if(empl_id == employees.get(i).getId())
                                               {
                                                   HTMLPartial += "<option value='" + employees.get(i).getId() + "' selected='true'>" + employees.get(i).getfName() + " " + employees.get(i).getlName() + "</option>";
                                               }  
                                               else
                                               {
                                                   HTMLPartial += "<option value='" + employees.get(i).getId() + "'>" + employees.get(i).getfName() + " " + employees.get(i).getlName() + "</option>";
                                               }
                                           }
                                       }
                                       catch(Exception e)
                                       {
                                           HTMLPartial += "<option value='0'>Error: cannot access DataBase!</option>";
                                       }
                    HTMLPartial += "</select><br/>"
                                    +    "   <input id ='submit' type='submit' value='BUSCAR' />"
                                    +    " <br/>"
                                    +    " <div  class='clean-lightblue'> "
                                    +    " <input type='hidden' name='dept' value='" + id_dept + "' />";
                            
                     if(q==1)
                     {
                        HTMLPartial +=  " <input type='radio' name='15days' value='1'checked='true'> Quincena previa </input>"
                                    + " <input type='radio' name='15days' value='2'> Quincena en curso </input>";
                     }
                     else
                     {
                       HTMLPartial +=  " <input type='radio' name='15days' value='1'> Quincena previa </input>"
                                    + " <input type='radio' name='15days' value='2' checked='true'> Quincena en curso </input>";
                     }
                    
                            
                            
                    HTMLPartial +=  " </div>"
                                    +    " <br/>" ;
                    return HTMLPartial;
     }
}
